package com.restaurant.application.indexes.couponlist.support;

import com.nebutown.base.ViewSpec;
import com.nebutown.base.data.ViewUpdate;
import com.nebutown.description.data.UnitForGeneration;
import com.nebutown.generation.PickableBean;
import com.nebutown.generation.basictype.UID;
import com.nebutown.supporthome.AbstractBase;
import com.nebutown.supporthome.CmdCapsule;
import com.restaurant.application.coupon.support.CouponData;
import com.restaurant.application.indexes.couponlist.AssistCouponListImpl;
import com.restaurant.application.indexes.couponlist.mysql.CouponListBean;
import com.restaurant.application.indexes.couponlist.mysql.CouponListCriteria;

public class AssistCouponListBase extends AbstractBase {
    private UnitForGeneration desc = new UnitForGeneration();

    public AbstractAssistCouponList getImpl() {
        AbstractAssistCouponList inst = new AssistCouponListImpl();
        inst.setBase(this, getEscort());
        return inst;
    }

    @Override
    public AssistCouponListOutFace getUnitFace() {
        return new AssistCouponListOutFace(this);
    }

    @Override
    protected Object callDistr(String name, Object... param) {
        switch(name) {
            case "createBean": return getImpl().createBean((UID)param[0], (CouponData)param[1]);
            case "updateBean":
                return getImpl().updateBean((UID) param[0], (CouponData) param[1], (CouponListBean) param[2]);
            case "getMyCardUid":
                return getImpl().getMyCardUid((String) param[0]);
            case "getMyCardBeanList":
                return getImpl().getMyCardBeanList((UID) param[0], (String) param[1], (String) param[2]);
            case "getId": return getImpl().getId();
            case "getFullView":
                setIsRefresher();
                return getImpl().getFullView();
            case "getViewLead": return getImpl().getViewLead((ViewSpec)param[0]);
            case "getEffectiveInterface":
                return getImpl().getEffectiveInterface();
        }
        return null;
    }

    @Override
    protected boolean authDistr(String name) {
        switch(name) {
        }
        return true;
    }

    @Override
    public CmdCapsule getUICall(int cmd) {
        switch(cmd) {
            case 0: return AbstractAssistCouponList.CMD_SEARCH;
        }
        return null;
    }

    @Override
    public ViewUpdate uiCall(int cmd, PickableBean param, int... seq) {
        switch(cmd) {
            case 0: return getImpl().search((CouponListCriteria)param, seq);
        }
        return null;
    }
}
